package cn.z;
import java.util.concurrent.Callable;
/**
 * @author zch
 * 场景2：执行需要返回值的异步任务
 */
public class CallableAnnyTask implements Callable<Long> {
	private int[] arr;
	CallableAnnyTask(int[] arr) {
		this.arr = arr;
	}
	@Override
	public Long call() throws Exception {
		long result = 0;
		for (int value : arr) {
			result += value;
		}
		return result;
	}
}
